export function getOrderPointPayload(orderDetail, centMap) {
  // 获取所有的 商品
  const productInfoList =
    orderDetail.productCarConfirmOrgResponsesList &&
    orderDetail.productCarConfirmOrgResponsesList.length > 0
      ? orderDetail.productCarConfirmOrgResponsesList
          .map((item) => {
            return item.productCarConfirmInfoList;
          })
          .flat()
      : [];

  const simplePrice = productInfoList.map((item) => {
    return parseFloat(item.price);
  });

  centMap.expressFeeCent && simplePrice.push(centMap.expressFeeCent / 100);

  const sumCent =
    (centMap.productTotalCent -
      centMap.promotionCent -
      centMap.couponCent +
      centMap.expressFeeCent) /
    100;

  return {
    simplePrice,
    sumPrice: sumCent < 0 ? 0 : sumCent,
  };
}
